package vip.mall;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Asus
 * @Date 2025/2/9 23:20
 */
@SpringBootApplication
@Slf4j
@RestController
public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        ConfigurableEnvironment environment = run.getEnvironment();
        String port = environment.getProperty("server.port");
        log.info("""
                ---------------------------------------------------
                Application is running
                basic url: http://127.0.0.1:{}
                doc   url: http://127.0.0.1:{}/doc.html
                ---------------------------------------------------
                """,port,port);
    }
    @GetMapping("/")
    String hello(){
        return "hello";
    }
}
